import express from 'express'
import cors from 'cors'

const app = express()

app.use(cors())
app.use(express.json())

let lists: any[] = []

app.post('/save', (req, res) => {
  console.log(req.body)
  lists = req.body.lists
  return res.json({ success: true })
})

app.get('/load', (req, res) => res.json({ lists }))

app.listen(4000, () =>
  console.log(`Server is running on http://localhost:4000`)
)
